<?php
function fungsi($file) {
	if(file_exists(ABSPATH.'functions/func_'.$file.'.php')){
		require_once ABSPATH.'functions/func_'.$file.'.php';
	}
	
}

function jumlah_data($tabel) {
	return mysql_num_rows(mysql_query("SELECT * FROM t_".$tabel));
}

function kelamin($kd) {
	if($kd=="L") {
		echo "Laki-laki";
	} else {
		echo "Perempuan";
	}
}

function koneksi_buka() {
	mysql_select_db(DB_NAMA,mysql_connect(DB_HOST,DB_USER,DB_PASSWORD));
}

function koneksi_tutup() {
	mysql_close(mysql_connect(DB_HOST,DB_USER,DB_PASSWORD));
}

function konversi_tanggal($format, $tanggal) {
	$en=array("Sun","Mon","Tue","Wed","Thu","Fri","Sat","Jan","Feb",
	"Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
	$id=array("Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu",
	"Januari","Pebruari","Maret","April","Mei","Juni","Juli","Agustus","September",
	"Oktober","November","Desember");
	return str_replace($en,$id,date($format,strtotime($tanggal)));
}

function loncat($url) {
	header("Location:".$url);
}

function panggil_header() {
	require_once 'header.php';
}

function panggil_footer() {
	require_once 'footer.php';
}


?>
